Skip to content

feat(registration): broaden registration readiness and config signals - #73

Merged
JSONbored merged 2 commits into
JSONbored:mainfrom
Khaostica:claude/strange-wright-aa219f
Jun 1, 2026
Merged

feat(registration): broaden registration readiness and config signals#73
JSONbored merged 2 commits into
JSONbored:mainfrom
Khaostica:claude/strange-wright-aa219f

Conversation

@Khaostica

Copy link
Copy Markdown
Contributor

Summary

Completes #38 by turning the repo-owner registration-readiness and Gittensor config recommendation into pure, unit-tested signal builders, and broadening the readiness report to evaluate every dimension the issue requires.

Output stays advisory and private/API-first: no public GitHub output, no wallet/hotkey/score exposure.

What changed

  • Added src/signals/registration-readiness.ts with two pure builders:
    • buildRegistrationReadiness() — direct-PR readiness, issue-discovery readiness, label policy, maintainer-cut readiness, test-gate health, queue health, contribution docs, and GitHub App behavior (install state, quiet-by-default, missing permission/event warnings).
    • buildGittensorConfigRecommendation() — initial config recommendation with issueDiscoveryShare, label multipliers, maintainerCut, linked-issue policy, explicit tradeoffs, reasons, and warnings.
  • Reworked GET /v1/repos/:owner/:repo/registration-readiness and .../gittensor-config-recommendation to delegate to the pure builders, and loaded installation health so the readiness report can describe real GitHub App behavior.
  • Maintainer economics (maintainerCut) stay separated from miner rewards, and direct-PR-first stays the default unless issue-discovery intake is explicitly ready.
  • Extended the RegistrationReadiness and GittensorConfigRecommendation OpenAPI schemas with the new fields.
  • Added test/unit/registration-readiness.test.ts covering the required scenarios: ready repo, not-ready repo, issue-discovery-disabled recommendation, maintainer-cut readiness, missing-labels / missing-docs / missing-test-gate warnings, GitHub App permission/event warnings, lane variants, and a forbidden-public-language invariant.

Why

Issue #38 needs Gittensory to explain whether a repo is ready to attract Gittensor miner work and to recommend a safe initial config with tradeoffs. The previous inline logic (from the registration polish gate) did not evaluate test-gate or queue health, did not describe GitHub App behavior, and was only exercised through integration tests. Extracting tested builders closes those gaps and makes the signal verifiable.

Validation

  • npx tsc --noEmit (typecheck) — passes
  • npx vitest run test/unit/registration-readiness.test.ts test/integration/api.test.ts test/unit/openapi.test.ts — 26 passed
  • npm run docs:check — passes
  • New builder coverage: 100% statements/functions/lines, 96.55% branches (above the 95% gate)
  • The full npm run test:ci gate runs on CI. (Locally on Windows, the mcp-cli / local-branch suites fail with a libuv child-process assertion that reproduces identically on the unmodified base branch — environment-only, unrelated to this change.)

Safety

  • Backend-only change
  • No secrets, wallet details, raw trust scores, or private rankings exposed; report is private/API-first and covered by a forbidden-language test
  • Public text avoids compensation-seeking or optimization-tactic language
  • OpenAPI schemas updated to match behavior
  • No changelog changes (not a release PR)

Closes #38

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Khaostica this needs policy corrections before merge.

Required:

  • Resolve the conflict in src/api/routes.ts.
  • Do not treat disabled check runs as a registration-readiness warning; Gittensory intentionally defaults public checks off.
  • Fix config math: do not subtract issueDiscoveryShare from emissionShare; emissions are assigned externally and issue-discovery share is repo config semantics.
  • For Gittensory-specific recommendations, keep direct-PR-first posture and support the intended 30% maintainer cut when readiness is met.

@Khaostica
Khaostica requested a review from JSONbored May 30, 2026 19:15

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Khaostica The feature direction is still reasonable, and CI is green, but this cannot be merged in its current state.

A few notes:

  • Broadening registration readiness and config signals is useful, especially if the route stays aligned with the current API/OpenAPI structure.
  • The branch is currently conflicted with src/api/routes.ts.
  • Because current main has moved substantially in the app/API surfaces, I do not want to approve the old route shape through a conflict. The conflict needs to be resolved first so the reviewed code matches what would actually land.

Required changes:

  • Rebase onto current main and resolve the src/api/routes.ts conflict.
  • Confirm the registration-readiness response still matches the current API and OpenAPI conventions.
  • Re-run validation after the rebase.

Expected validation:

  • npm run typecheck
  • npm run test:coverage

Rebased onto current main and resolved the src/api/routes.ts conflict so
the reviewed code matches what would actually land. The route now delegates
to pure, unit-tested signal builders instead of inline logic.

- Add src/signals/registration-readiness.ts with two pure builders:
  - buildRegistrationReadiness(): direct-PR readiness, issue-discovery
    readiness, label policy (incl. trusted-pipeline), maintainer-cut
    readiness, test-gate health, queue health, contribution docs, and
    GitHub App behavior (install state, quiet-by-default, missing
    permission/event warnings).
  - buildGittensorConfigRecommendation(): initial config recommendation
    with issueDiscoveryShare, label multipliers, maintainerCut, linked-issue
    policy, explicit tradeoffs, reasons, and warnings.
- Reworked GET /v1/repos/:owner/:repo/registration-readiness and
  .../gittensor-config-recommendation to delegate to the builders over the
  current buildRepoIntelligenceResponse intelligence layer, and load
  installation health so the report can describe real GitHub App behavior.
- Config math: directPrShare is the within-repo split (1 - issueDiscoveryShare)
  and is not derived from the externally-assigned emissionShare; target a 30%
  maintainer cut when readiness is met. Check runs intentionally default off,
  so their state is informational in testCoverageHealth, not a warning.
- Extended the RegistrationReadiness and GittensorConfigRecommendation OpenAPI
  schemas (and regenerated apps/gittensory-ui/public/openapi.json) to match.
- Added test/unit/registration-readiness.test.ts covering ready/not-ready
  repos, issue-discovery-disabled recommendation, maintainer-cut readiness,
  missing-labels/docs/test-gate warnings, GitHub App permission/event
  warnings, lane variants, and a forbidden-public-language invariant.

Validation: npm run typecheck passes; registration-readiness, api
integration, and openapi suites pass (new builder at 100% lines, 99% branch);
npm run ui:openapi:check passes.

Closes JSONbored#38
@Khaostica
Khaostica force-pushed the claude/strange-wright-aa219f branch from b8f292b to 59cc531 Compare June 1, 2026 14:17
@Khaostica
Khaostica requested a review from JSONbored June 1, 2026 14:29

@JSONbored JSONbored left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Khaostica This is ready from my side. The registration-readiness logic is now centralized in registration-readiness, the API route is mostly response glue, and the tests cover direct/split/issue-discovery policy, disabled public surfaces, config quality, and readiness blockers. Current checks are green and the merge tree is clean.

@dosubot dosubot Bot added the lgtm label Jun 1, 2026
@JSONbored
JSONbored merged commit 57d7315 into JSONbored:main Jun 1, 2026
3 checks passed
@JSONbored JSONbored added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. and removed feature gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(registration): add Gittensory registration readiness and config recommendation

2 participants